import {globalConfig} from "../../config/globalConfig";

export interface SwimShopData {
  name?: string,
  id?: number,
  fragmentId?: number,
  mergeCount?: number,
  state?: number,
  way?: number,
  quality?: number,
  sortScore?: number,
  currencytype?: number,
  rmb?: number,
}

export class SwimModel {
  private _shopSwimData: Array<SwimShopData>

  constructor() {
    this._shopSwimData = globalConfig.item.filter((value: any) => value.type === 5).map((swim: any) => {
      return {
        name: swim.name,
        id: swim.id,
        fragmentId: swim.target,
        mergeCount: swim.number,
        way: swim.way,
        state: 0,
        quality: swim.value,
        sortScore: 0,
        type: swim.type,
        des: swim.des,
        currencytype: swim.currencytype,
        rmb: swim.rmb
      }
    });
  }

  get shopSwimData(): Array<SwimShopData> {
    return this._shopSwimData;
  }
}